package com.theeviljames.pure;

import com.theeviljames.exceptions.ComplexANNException;

public class OldComplexANN {

	private OldComplexANNLayer[] ann;
	private int[][] topology;
	private static IComplexMatrixOps c = ComplexMatrixOps.getComplexMatrixOps();
	
	public OldComplexANN(int[][] topology, double limit, boolean signed){
		this.topology = topology;
		ann = new OldComplexANNLayer[topology.length];
		for(int i = 0; i < topology.length; i++){
			ann[i] = new OldComplexANNLayer(topology[i], limit, signed);
		}
	}
	
	public Complex[][][] getOutputs(Complex[][][] inputs) throws ComplexANNException{
		if(inputs.length!=topology.length)throw new ComplexANNException("The number of inputs must be equal to the number of input neurons");
		Complex[][][] outputs = new Complex[topology.length][][];
		for(int i = 0; i < topology.length; i++){
			outputs[i] = ann[i].getOutputs(inputs[i]);
		}
		return outputs;
	}
	
	public void print(){
		for(int i = 0; i < ann.length; i++){
			System.out.println("ANN layer " + i + "\n");
			ann[i].print();
		}
	}
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try{
			OldComplexANN ann = new OldComplexANN(new int[][]{{2,2}},1,true);
			ann.print();
			Complex[][] inputs = new Complex[][]{{new Complex(1,2),new Complex(1,2)}};
			//Complex[][] outputs = ann.getOutputs(inputs);
			System.out.println("Outputs\n");
			//c.print(outputs);
		}
		catch(Exception e){
			
		}
	}

}
